
namespace SangsTools
{
    public class SingletonScript<T> where T : SingletonScript<T>, new()
    {
        private static T instance;
        public static T Ins
        {
            get
            {
                if (instance == null)
                {
                    instance = new T();
                    instance.OnInsInit();
                }
                return instance;
            }
        }

        protected virtual void OnInsInit() { }
    }
}